//package com.jarvan.config;
//
//import java.io.IOException;
//import java.io.PrintWriter;
//import java.io.Serializable;
//
//import javax.security.auth.message.AuthException;
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.AuthenticationEntryPoint;
//
//public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint, Serializable {
//
//  /**
//   *
//   */
//  private static final long serialVersionUID = 282623472467385157L;
//
//  @Override
//  public void commence(HttpServletRequest request,
//                       HttpServletResponse response,
//                       AuthenticationException authenticationException)
//      throws IOException, ServletException {
//    //  Auto-generated method stub
//    response.setStatus(200);
//    response.setCharacterEncoding("UTF-8");
//    response.setContentType("application/json; charset=utf-8");
//    PrintWriter printWriter = response.getWriter();
//    String bodString = ResultJson.failure(ResultCode.UNAUTHORIZED.getCode(), new AuthException().getMessage()).toString();
//    printWriter.write(bodString);
//    printWriter.flush();
//  }
//
//}